<template>
	<view class="logisMessage">
		<view class="uni-list">
			<view class="uni-list-cell" v-for="(item,index) in dataList" :key="index">
				<view class="title">
					<view class="status">
						<!-- 订单发货通知 -->
					</view>
					<view class="time">
						{{JSON.parse(item.logisticsInfo).time}}
					</view>
				</view>
				<view class="info">
					<image :src="item.productPic" lazy-load="true" mode="scaleToFill"></image>
					<view class="right">
						<view class="desction">
							{{JSON.parse(item.logisticsInfo).context}}
						</view>
						<view class="goLogisInfo" @tap="goLogisInfo(item.orderId)">
							查看物流详情
						</view>
					</view>
				</view>
			</view>


		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageNum: 1,
				dataList: []
			}
		},
		onLoad() {
			this.getDataList()
		},
		onReachBottom() {
			this.getDataList()
		},
		onPullDownRefresh() {
			this.pageNum = 1;
			this.dataList = [];
			this.getDataList();
		},
		methods: {
			getDataList() {
				let data = {
					"pageNum": this.pageNum,
					"pageSize": 10,
				}
				this.$http.post('/api/v1.0/message/viewExpressInfo',data,res=>{
					this.dataList = this.dataList.concat(res.data.data.list)
					this.pageNum++
				})
			},
			goLogisInfo(id){
				uni.navigateTo({
					url:'../logistics/logistics?orderId=' + id
				})
			}
		}
	}
</script>

<style lang="scss">
	.logisMessage {
		min-height: 100vh;
		background-color: #f2f2f2;
		padding-top: 30upx;
		box-sizing: border-box;
		padding-bottom: 20upx;

		.uni-list-cell {
			width: 694upx;
			margin: 0 auto;
			font-size: 28upx;
			color: #333;
			border-radius: 20upx;
			margin-bottom: 30upx;
			box-sizing: border-box;
			background-color: #fff;

			.title {
				padding: 20upx 20upx 20upx 30upx;
				border-bottom: 1upx solid #F2F2F2;
				display: flex;
				justify-content: space-between;
				box-sizing: border-box;

				.status {
					font-size: 32upx;
					font-weight: bold;
				}

				.time {
					color: #808080;
					font-size: 24upx;
				}
			}

			.info {
				display: flex;
				justify-content: flex-start;
				padding: 20upx 20upx 20upx 30upx;
				box-sizing: border-box;
				image {
					width: 205upx;
					height: 205upx;
					margin-right: 20upx;
				}

				.right {
					width: 388upx;

					.desction {
						display: -webkit-box;
						overflow: hidden;
						white-space: normal !important;
						text-overflow: ellipsis;
						word-wrap: break-word;
						-webkit-line-clamp: 2;
						-webkit-box-orient: vertical;
						color: #4D4D4D;
						font-size: 26upx;
					}
					.goLogisInfo{
						margin-top: 50upx;
						border: 1upx solid #F63810;
						border-radius: 10upx;
						width: 200upx;
						height: 55upx;
						text-align: center;
						line-height: 55upx;
						color: #F63810;
					}
				}

			}

		}
	}
</style>
